//
//  WHMoneyDetailHeaderView.m
//  SquirrelCourier
//
//  Created by 邓伟浩 on 2019/1/4.
//  Copyright © 2019 邓伟浩. All rights reserved.
//

#import "WHMoneyDetailHeaderView.h"

@interface WHMoneyDetailHeaderView ()

@property (nonatomic, strong) UILabel *dateLabel;
@property (nonatomic, strong) UILabel *typeLabel;
@property (nonatomic, strong) UILabel *moneyLabel;
@property (nonatomic, strong) UILabel *statusLabel;

@end

@implementation WHMoneyDetailHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setMoneyDetailHeaderUI];
    }
    return self;
}

- (void)setMoneyDetailHeaderUI {
    [self addSubview:({
        _dateLabel = [[UILabel alloc] init];
        _dateLabel.textAlignment = NSTextAlignmentCenter;
        _dateLabel.adjustsFontSizeToFitWidth = YES;
        _dateLabel.textColor = CMDarkOrangeColor;
        _dateLabel.font = SYSTEMFONT(kRealwidth(15));
        _dateLabel.text = @"交易时间";
        _dateLabel.backgroundColor = HexColor(@"ffeee5");
        
        ViewBorderRadius(_dateLabel, 0, 0.5, CLineColor);
        
        _dateLabel;
    })];
    [_dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.mas_equalTo(self);
        make.width.mas_equalTo(kRealwidth(115));
    }];
    
    [self addSubview:({
        _typeLabel = [[UILabel alloc] init];
        _typeLabel.textAlignment = NSTextAlignmentCenter;
        _typeLabel.adjustsFontSizeToFitWidth = YES;
        _typeLabel.textColor = CMDarkOrangeColor;
        _typeLabel.font = SYSTEMFONT(kRealwidth(15));
        _typeLabel.text = @"类型";
        _typeLabel.backgroundColor = HexColor(@"ffeee5");
        
        ViewBorderRadius(_typeLabel, 0, 0.5, CLineColor);
        
        _typeLabel;
    })];
    [_typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self);
        make.left.mas_equalTo(_dateLabel.mas_right);
        make.width.mas_equalTo(kRealwidth(85));
    }];
    
    [self addSubview:({
        _moneyLabel = [[UILabel alloc] init];
        _moneyLabel.textAlignment = NSTextAlignmentCenter;
        _moneyLabel.adjustsFontSizeToFitWidth = YES;
        _moneyLabel.textColor = CMDarkOrangeColor;
        _moneyLabel.font = SYSTEMFONT(kRealwidth(15));
        _moneyLabel.text = @"金额(元)";
        _moneyLabel.backgroundColor = HexColor(@"ffeee5");
        
        ViewBorderRadius(_moneyLabel, 0, 0.5, CLineColor);
        
        _moneyLabel;
    })];
    [_moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self);
        make.left.mas_equalTo(_typeLabel.mas_right);
        make.width.mas_equalTo(kRealwidth(85));
    }];
    
    [self addSubview:({
        _statusLabel = [[UILabel alloc] init];
        _statusLabel.textAlignment = NSTextAlignmentCenter;
        _statusLabel.adjustsFontSizeToFitWidth = YES;
        _statusLabel.textColor = CMDarkOrangeColor;
        _statusLabel.font = SYSTEMFONT(kRealwidth(15));
        _statusLabel.text = @"状态";
        _statusLabel.backgroundColor = HexColor(@"ffeee5");
        
        ViewBorderRadius(_statusLabel, 0, 0.5, CLineColor);
        
        _statusLabel;
    })];
    [_statusLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self);
        make.left.mas_equalTo(_moneyLabel.mas_right);
        make.width.mas_equalTo(kRealwidth(90));
    }];
}

@end
